﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;
using System.Text;

namespace Web_HengliSeed.en_us
{
    public partial class Site : System.Web.UI.MasterPage
    {
        private const string language = "en";
        protected void Page_Load(object sender, EventArgs e)
        {
            //System.DateTime startTime = (System.DateTime)Application["StartTime"];
            //System.DateTime endTime = System.DateTime.Now;
            //System.TimeSpan ts = endTime - startTime;
            //Application["runtime"] = (Convert.ToDouble((ts.Milliseconds)) / 1000);
        }

        public string GetNewsClass()
        {
            using (OleDbDataReader read = BLL.NewsInfo.GetClassMesAll(language))
            {
                StringBuilder sbHtml = new StringBuilder();
                sbHtml.Append("<ul>");
                while (read.Read())
                {
                    sbHtml.Append(string.Format("<li><a href='Articles.aspx?c={0}'><strong>{1}</strong></a></li>", read["T_NewsClassID"], read["T_NewsClassName"]));
                }
                sbHtml.Append("</ul>");

                return sbHtml.ToString();
            }
        }

        public string GetProClass()
        {
            using (OleDbDataReader read = BLL.ProductInfo.GetClassMesAll(language))
            {
                StringBuilder sbHtml = new StringBuilder();
                sbHtml.Append("<ul>");
                while (read.Read())
                {
                    sbHtml.Append(string.Format("<li><a href='Products.aspx?c={0}'><strong>{1}</strong></a></li>", read["T_ProClassID"], read["T_ProClassName"]));
                }
                sbHtml.Append("</ul>");

                return sbHtml.ToString();
            }
        }
    }
}